
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:p="http://primefaces.org/ui"
        xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
        <title>Admin Panel</title>
</h:head>
<h:body style="background:#2A2D30">

<h:form>
<p:panel style="height:400px">
                <p:panel header="Dream Travel Agancy!">
                        <h:panelGrid columns="3" id="add_excursionGrid">
                                <h:outputLabel for="eName">Name:</h:outputLabel>
                                <p:inputText id="eName" value="#{excursionbean.excursiondto.eName}" />
                                <p:message for="eName" />


                                <h:outputLabel for="eCity">City:</h:outputLabel>
                                <p:inputText id="eCity"
                                        value="#{excursionbean.excursiondto.eCity}" />
                                <p:message for="eCity" />

                                <h:outputLabel for="eDescrptiont">Descrptiont:</h:outputLabel>
                                <p:inputText id="eDescrptiont" value="#{excursionbean.excursiondto.eDescription}" 
                                 style="height:50px"/>
                                <p:message for="eDescrptiont" />
                                
                                 <h:outputLabel for="ePrice">Cost:</h:outputLabel>
                                <p:inputText id="ePrice"
                                        value="#{excursionbean.excursiondto.ePrice}" />
                                <p:message for="ePrice" />
                                                       

                        </h:panelGrid>
                        <p:commandButton id="addhotel" value="Add Excursion"
                                update="add_excursionGrid,successDlg" title="Complete"
                                action="#{excursionbean.register()}"
                                oncomplete="PF('successDialog').show()" />

                </p:panel>
                <p:dialog header="Status" widgetVar="successDialog" resizable="false"
                        id="successDlg" showEffect="fade" hideEffect="drop" modal="true"
                        draggable="no">

                        <h:outputText rendered="#{(excursionbean.excursiondto.eName)}"
                                value="Error!No data added" />

                        <p:panel rendered="#{(not empty excursionbean.excursiondto.eName)}">
                                <h:panelGrid columns="3">
                                        <h:outputText value="The Excursion '"></h:outputText>
                                        <h:outputText value="#{(excursionbean.excursiondto.eName)}" />
                                        <h:outputText value="' is  added successfully" />
                                </h:panelGrid>
                        </p:panel>
                        <h:form>
                                <br />
                                <p:button value="OK!"
                                        outcome="excursion.xhtml" />
                              
                                                        </h:form>
                </p:dialog>
                <p:panel>
      <p:button value="back" outcome="index.xhtml" />
      </p:panel>
</p:panel>
        </h:form>
        
</h:body>
</html>